home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / Commander Sets / 4D AmountString / 4D AmountString.rsrc / TEXT_18901_††AmountString function.txt < prev    next >
Encoding:
Text File  |  1994-09-14  |  2.4 KB  |  58 lines

  1. RR AmountString(amount; curr; format) -> line
  2.  
  3. line      string (255)  returns the amount in words. It is empty when an
  4.                                 error occured.
  5.  
  6. amount  real              contains the number to convert to words. This
  7.                                  number can be very large but is limited by the
  8.                                  data used for the text and the maximum length set
  9.                                  for the result string. But for each currency the
  10.                                  maximum number is at least 999,999,999,999.
  11.                                  The decimal digits are truncated to the number of
  12.                                  digits (0, 2 or 3) needed for the specified
  13.                                  currency.
  14.  
  15. curr      string (4)      indicates to which currency you want to convert.
  16.                                  These are (based on) ISO 4217 currency codes.
  17.                                  For multi-lingual countries a fourth character
  18.                                  indicates the language.
  19.                                  The currency codes which are supported are
  20.                                  listed in the next chapter.
  21.  
  22. format  integer          specifys the format of the output string. See
  23.                                  below for a list of supported formats.
  24.  
  25.  
  26. With all formats you need to specify the currency, even with the plain format, in order to specify the language to use. When using the plain format the maximum number of digits after the decimal point is six, and not limited by the number normally used with the specified currency.
  27. You won't notice much difference between formats 1, 2 and 3 when working with a currency which does not have minor units (i.e. Italian Lire and Portuguese Escudo).
  28.  
  29.  
  30. Formats:
  31. # name:    description:
  32. 0 plain    only words, no currency
  33.            (twenty-three point nine two)
  34. 1 short    full with currency and number of units
  35.            (twenty-three U.S. Dollars and 92 cents)
  36. 2 long     full with currenct and units string
  37.            (twenty-three U.S. Dollars and ninety two cents)
  38. 3 official official with currency
  39.            (twenty-three and 92/100 U.S. Dollars)
  40.  
  41.  
  42. Examples:
  43.   C_REAL($value)
  44. ¬†¬†C_STRING (4; $currency)
  45. ¬†¬†C_STRING (255; $result)
  46. ¬†¬†C_INTEGER ($format)
  47.  
  48. ¬†¬†$value := 1234.56
  49. ¬†¬†$currency := "USD"
  50. ¬†¬†$format := 1
  51.  
  52. ¬†¬†$result := RR AmountString ($value; $currency; $format)
  53.  
  54. ¬†¬†ALERT ($result)
  55.  
  56.  
  57.  
  58.